<div class="admin">
    <div class="tab panel dux-box admin-panel">
        <div class="panel-head"><strong>快递公司</strong></div>
        <div class="padding border-bottom">
            <a href="{:U('Member/add')}" class="button button-small bg-green">新增快递</a>
        </div>
        <div class="fixed-empty"></div>
        <table class="table tb-type2">
            <tbody>
                <tr>
                    <td width="10%"><label for="search_brand_name">首字母索引：</label></td>
                    <td>
                        <a href="{:U('index',array('e_letter'=>A))}">A</a>&nbsp;&nbsp;
                        <a href="{:U('index',array('e_letter'=>B))}">B</a>&nbsp;&nbsp;
                        <a href="{:U('index',array('e_letter'=>C))}">C</a>&nbsp;&nbsp;
                        <a href="{:U('index',array('e_letter'=>D))}">D</a>&nbsp;&nbsp;
                        <a href="{:U('index',array('e_letter'=>E))}">E</a>&nbsp;&nbsp;
                        <a href="{:U('index',array('e_letter'=>F))}">F</a>&nbsp;&nbsp;
                        <a href="{:U('index',array('e_letter'=>G))}">G</a>&nbsp;&nbsp;
                        <a href="{:U('index',array('e_letter'=>H))}">H</a>&nbsp;&nbsp;
                        <a href="{:U('index',array('e_letter'=>I))}">I</a>&nbsp;&nbsp;
                        <a href="{:U('index',array('e_letter'=>J))}">J</a>&nbsp;&nbsp;
                        <a href="{:U('index',array('e_letter'=>K))}">K</a>&nbsp;&nbsp;
                        <a href="{:U('index',array('e_letter'=>L))}">L</a>&nbsp;&nbsp;
                        <a href="{:U('index',array('e_letter'=>M))}">M</a>&nbsp;&nbsp;
                        <a href="{:U('index',array('e_letter'=>N))}">N</a>&nbsp;&nbsp;
                        <a href="{:U('index',array('e_letter'=>O))}">O</a>&nbsp;&nbsp;
                        <a href="{:U('index',array('e_letter'=>P))}">P</a>&nbsp;&nbsp;
                        <a href="{:U('index',array('e_letter'=>Q))}">Q</a>&nbsp;&nbsp;
                        <a href="{:U('index',array('e_letter'=>R))}">R</a>&nbsp;&nbsp;
                        <a href="{:U('index',array('e_letter'=>S))}">S</a>&nbsp;&nbsp;
                        <a href="{:U('index',array('e_letter'=>T))}">T</a>&nbsp;&nbsp;
                        <a href="{:U('index',array('e_letter'=>U))}">U</a>&nbsp;&nbsp;
                        <a href="{:U('index',array('e_letter'=>V))}">V</a>&nbsp;&nbsp;
                        <a href="{:U('index',array('e_letter'=>W))}">W</a>&nbsp;&nbsp;
                        <a href="{:U('index',array('e_letter'=>X))}">X</a>&nbsp;&nbsp;
                        <a href="{:U('index',array('e_letter'=>Y))}">Y</a>&nbsp;&nbsp;
                        <a href="{:U('index',array('e_letter'=>Z))}">Z</a>&nbsp;&nbsp;
                    </td>
                </tr>
            </tbody>
        </table>
        <table class="table tb-type2">
            <thead>
                <tr class="thead">
                    <th width="6%">首字母</th>
                    <th width="12%">快递公司</th>
                    <th width="*">网址 (仅供参考)</th>
                    <th width="8%">常用</th>
                </tr>
            </thead>
            <tbody>
            <foreach name="list" item="v">
                <tr class="hover">
                    <td>{$v['e_letter']}</td>
                    <td>{$v['e_name']}</td>
                    <td>{$v['e_url']}</td>
                    <td>
                        <if condition="$v['e_state'] eq 1">
                            <a class="button bg-green button-little" href="javascript:(0)" title="取消为常用物流" onclick="tuijian({$v['id']},'已设置，确认取消此设置吗？')"><i class="icon-check-square"></i>常用物流</a>
                            <else />
                            <a class="button bg-gray button-little" href="javascript:(0)" title="设置为常用物流" onclick="tuijian({$v['id']},'未设置，确认设置常用吗？')"><i class="icon-times-circle"></i>非常用物流</a>
                        </if>
                    </td>
                </tr>
            </foreach>
            </tbody>
            <tfoot class="panel-foot">
                <tr>
                    <td colspan="4"><div class="pages clearfix">{$pages}</div></td>
                </tr>
            </tfoot>
        </table>
        <div class="clear"></div>
    </div>
</div>
<script>

    $(".dianji").click(function () {

        var v = $(this).attr("class").substr(7);
        switch (v) {
            case "enabled" :
                v = 1;
                break;
            case "disabled":
                v = 0;
                break;
        }
        var c = $(this).attr("c");
        var id = $(this).attr("id");
        var t = $(this);
        $.ajax({
            type: "POST",
            url: "/Express/zhuang",
            data: {'v': v, 'c': c, 'id': id},
            dataType: "json",
            success: function (date) {
                if (date) {
                    id = '#' + id;
                    if (!v) {
                        t.attr("class", "dianji enabled");
                    } else {
                        t.attr("class", "dianji disabled");
                    }

                } else {
                    alert('修改失败');
                }
            }

        });


    });
</script>
